package com.viewpagertext.DBHelper.Dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.viewpagertext.Model.DownloadMusic;
import com.viewpagertext.utils.PermissionUtils;

import java.util.List;

@Dao
public interface DownloadMusicDao {

    // 获取所有本地音乐
    @Query("SELECT * FROM DownloadMusic")
    public List<DownloadMusic> getAllDownloadMusic();

    // 插入下载音乐的信息
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    public void insertDownloadMusic(DownloadMusic downloadMusic);

    @Query("DELETE FROM DownloadMusic WHERE name = :name AND singer = :singer")
    public void deleteDownloadMusicByNameAndSinger(String name, String singer);
}
